package com.server.Example;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * The type Types example.
 */
public class TypesExample {
    /**
     * The Order by clause.
     */
    protected String orderByClause;

    /**
     * The Distinct.
     */
    protected boolean distinct;

    /**
     * The Ored criteria.
     */
    protected List<Criteria> oredCriteria;

    /**
     * Instantiates a new Types example.
     */
    public TypesExample() {
        oredCriteria = new ArrayList<>();
    }

    /**
     * Sets order by clause.
     *
     * @param orderByClause the order by clause
     */
    public void setOrderByClause(String orderByClause) {
        this.orderByClause = orderByClause;
    }

    /**
     * Gets order by clause.
     *
     * @return the order by clause
     */
    public String getOrderByClause() {
        return orderByClause;
    }

    /**
     * Sets distinct.
     *
     * @param distinct the distinct
     */
    public void setDistinct(boolean distinct) {
        this.distinct = distinct;
    }

    /**
     * Is distinct boolean.
     *
     * @return the boolean
     */
    public boolean isDistinct() {
        return distinct;
    }

    /**
     * Gets ored criteria.
     *
     * @return the ored criteria
     */
    public List<Criteria> getOredCriteria() {
        return oredCriteria;
    }

    /**
     * Or.
     *
     * @param criteria the criteria
     */
    public void or(Criteria criteria) {
        oredCriteria.add(criteria);
    }

    /**
     * Or criteria.
     *
     * @return the criteria
     */
    public Criteria or() {
        Criteria criteria = createCriteriaInternal();
        oredCriteria.add(criteria);
        return criteria;
    }

    /**
     * Create criteria criteria.
     *
     * @return the criteria
     */
    public Criteria createCriteria() {
        Criteria criteria = createCriteriaInternal();
        if (oredCriteria.size() == 0) {
            oredCriteria.add(criteria);
        }
        return criteria;
    }

    /**
     * Create criteria internal criteria.
     *
     * @return the criteria
     */
    protected Criteria createCriteriaInternal() {
        Criteria criteria = new Criteria();
        return criteria;
    }

    /**
     * Clear.
     */
    public void clear() {
        oredCriteria.clear();
        orderByClause = null;
        distinct = false;
    }

    /**
     * The type Generated criteria.
     */
    protected abstract static class GeneratedCriteria {
        /**
         * The Criteria.
         */
        protected List<Criterion> criteria;

        /**
         * Instantiates a new Generated criteria.
         */
        protected GeneratedCriteria() {
            super();
            criteria = new ArrayList<>();
        }

        /**
         * Is valid boolean.
         *
         * @return the boolean
         */
        public boolean isValid() {
            return criteria.size() > 0;
        }

        /**
         * Gets all criteria.
         *
         * @return the all criteria
         */
        public List<Criterion> getAllCriteria() {
            return criteria;
        }

        /**
         * Gets criteria.
         *
         * @return the criteria
         */
        public List<Criterion> getCriteria() {
            return criteria;
        }

        /**
         * Add criterion.
         *
         * @param condition the condition
         */
        protected void addCriterion(String condition) {
            if (condition == null) {
                throw new RuntimeException("Value for condition cannot be null");
            }
            criteria.add(new Criterion(condition));
        }

        /**
         * Add criterion.
         *
         * @param condition the condition
         * @param value     the value
         * @param property  the property
         */
        protected void addCriterion(String condition, Object value, String property) {
            if (value == null) {
                throw new RuntimeException("Value for " + property + " cannot be null");
            }
            criteria.add(new Criterion(condition, value));
        }

        /**
         * Add criterion.
         *
         * @param condition the condition
         * @param value1    the value 1
         * @param value2    the value 2
         * @param property  the property
         */
        protected void addCriterion(String condition, Object value1, Object value2, String property) {
            if (value1 == null || value2 == null) {
                throw new RuntimeException("Between values for " + property + " cannot be null");
            }
            criteria.add(new Criterion(condition, value1, value2));
        }

        /**
         * And type id is null criteria.
         *
         * @return the criteria
         */
        public Criteria andTypeIdIsNull() {
            addCriterion("Type_id is null");
            return (Criteria) this;
        }

        /**
         * And type id is not null criteria.
         *
         * @return the criteria
         */
        public Criteria andTypeIdIsNotNull() {
            addCriterion("Type_id is not null");
            return (Criteria) this;
        }

        /**
         * And type id equal to criteria.
         *
         * @param value the value
         * @return the criteria
         */
        public Criteria andTypeIdEqualTo(Integer value) {
            addCriterion("Type_id =", value, "typeId");
            return (Criteria) this;
        }

        /**
         * And type id not equal to criteria.
         *
         * @param value the value
         * @return the criteria
         */
        public Criteria andTypeIdNotEqualTo(Integer value) {
            addCriterion("Type_id <>", value, "typeId");
            return (Criteria) this;
        }

        /**
         * And type id greater than criteria.
         *
         * @param value the value
         * @return the criteria
         */
        public Criteria andTypeIdGreaterThan(Integer value) {
            addCriterion("Type_id >", value, "typeId");
            return (Criteria) this;
        }

        /**
         * And type id greater than or equal to criteria.
         *
         * @param value the value
         * @return the criteria
         */
        public Criteria andTypeIdGreaterThanOrEqualTo(Integer value) {
            addCriterion("Type_id >=", value, "typeId");
            return (Criteria) this;
        }

        /**
         * And type id less than criteria.
         *
         * @param value the value
         * @return the criteria
         */
        public Criteria andTypeIdLessThan(Integer value) {
            addCriterion("Type_id <", value, "typeId");
            return (Criteria) this;
        }

        /**
         * And type id less than or equal to criteria.
         *
         * @param value the value
         * @return the criteria
         */
        public Criteria andTypeIdLessThanOrEqualTo(Integer value) {
            addCriterion("Type_id <=", value, "typeId");
            return (Criteria) this;
        }

        /**
         * And type id in criteria.
         *
         * @param values the values
         * @return the criteria
         */
        public Criteria andTypeIdIn(List<Integer> values) {
            addCriterion("Type_id in", values, "typeId");
            return (Criteria) this;
        }

        /**
         * And type id not in criteria.
         *
         * @param values the values
         * @return the criteria
         */
        public Criteria andTypeIdNotIn(List<Integer> values) {
            addCriterion("Type_id not in", values, "typeId");
            return (Criteria) this;
        }

        /**
         * And type id between criteria.
         *
         * @param value1 the value 1
         * @param value2 the value 2
         * @return the criteria
         */
        public Criteria andTypeIdBetween(Integer value1, Integer value2) {
            addCriterion("Type_id between", value1, value2, "typeId");
            return (Criteria) this;
        }

        /**
         * And type id not between criteria.
         *
         * @param value1 the value 1
         * @param value2 the value 2
         * @return the criteria
         */
        public Criteria andTypeIdNotBetween(Integer value1, Integer value2) {
            addCriterion("Type_id not between", value1, value2, "typeId");
            return (Criteria) this;
        }

        /**
         * And type name is null criteria.
         *
         * @return the criteria
         */
        public Criteria andTypeNameIsNull() {
            addCriterion("Type_name is null");
            return (Criteria) this;
        }

        /**
         * And type name is not null criteria.
         *
         * @return the criteria
         */
        public Criteria andTypeNameIsNotNull() {
            addCriterion("Type_name is not null");
            return (Criteria) this;
        }

        /**
         * And type name equal to criteria.
         *
         * @param value the value
         * @return the criteria
         */
        public Criteria andTypeNameEqualTo(String value) {
            addCriterion("Type_name =", value, "typeName");
            return (Criteria) this;
        }

        /**
         * And type name not equal to criteria.
         *
         * @param value the value
         * @return the criteria
         */
        public Criteria andTypeNameNotEqualTo(String value) {
            addCriterion("Type_name <>", value, "typeName");
            return (Criteria) this;
        }

        /**
         * And type name greater than criteria.
         *
         * @param value the value
         * @return the criteria
         */
        public Criteria andTypeNameGreaterThan(String value) {
            addCriterion("Type_name >", value, "typeName");
            return (Criteria) this;
        }

        /**
         * And type name greater than or equal to criteria.
         *
         * @param value the value
         * @return the criteria
         */
        public Criteria andTypeNameGreaterThanOrEqualTo(String value) {
            addCriterion("Type_name >=", value, "typeName");
            return (Criteria) this;
        }

        /**
         * And type name less than criteria.
         *
         * @param value the value
         * @return the criteria
         */
        public Criteria andTypeNameLessThan(String value) {
            addCriterion("Type_name <", value, "typeName");
            return (Criteria) this;
        }

        /**
         * And type name less than or equal to criteria.
         *
         * @param value the value
         * @return the criteria
         */
        public Criteria andTypeNameLessThanOrEqualTo(String value) {
            addCriterion("Type_name <=", value, "typeName");
            return (Criteria) this;
        }

        /**
         * And type name like criteria.
         *
         * @param value the value
         * @return the criteria
         */
        public Criteria andTypeNameLike(String value) {
            addCriterion("Type_name like", value, "typeName");
            return (Criteria) this;
        }

        /**
         * And type name not like criteria.
         *
         * @param value the value
         * @return the criteria
         */
        public Criteria andTypeNameNotLike(String value) {
            addCriterion("Type_name not like", value, "typeName");
            return (Criteria) this;
        }

        /**
         * And type name in criteria.
         *
         * @param values the values
         * @return the criteria
         */
        public Criteria andTypeNameIn(List<String> values) {
            addCriterion("Type_name in", values, "typeName");
            return (Criteria) this;
        }

        /**
         * And type name not in criteria.
         *
         * @param values the values
         * @return the criteria
         */
        public Criteria andTypeNameNotIn(List<String> values) {
            addCriterion("Type_name not in", values, "typeName");
            return (Criteria) this;
        }

        /**
         * And type name between criteria.
         *
         * @param value1 the value 1
         * @param value2 the value 2
         * @return the criteria
         */
        public Criteria andTypeNameBetween(String value1, String value2) {
            addCriterion("Type_name between", value1, value2, "typeName");
            return (Criteria) this;
        }

        /**
         * And type name not between criteria.
         *
         * @param value1 the value 1
         * @param value2 the value 2
         * @return the criteria
         */
        public Criteria andTypeNameNotBetween(String value1, String value2) {
            addCriterion("Type_name not between", value1, value2, "typeName");
            return (Criteria) this;
        }

        /**
         * And type value is null criteria.
         *
         * @return the criteria
         */
        public Criteria andTypeValueIsNull() {
            addCriterion("Type_value is null");
            return (Criteria) this;
        }

        /**
         * And type value is not null criteria.
         *
         * @return the criteria
         */
        public Criteria andTypeValueIsNotNull() {
            addCriterion("Type_value is not null");
            return (Criteria) this;
        }

        /**
         * And type value equal to criteria.
         *
         * @param value the value
         * @return the criteria
         */
        public Criteria andTypeValueEqualTo(BigDecimal value) {
            addCriterion("Type_value =", value, "typeValue");
            return (Criteria) this;
        }

        /**
         * And type value not equal to criteria.
         *
         * @param value the value
         * @return the criteria
         */
        public Criteria andTypeValueNotEqualTo(BigDecimal value) {
            addCriterion("Type_value <>", value, "typeValue");
            return (Criteria) this;
        }

        /**
         * And type value greater than criteria.
         *
         * @param value the value
         * @return the criteria
         */
        public Criteria andTypeValueGreaterThan(BigDecimal value) {
            addCriterion("Type_value >", value, "typeValue");
            return (Criteria) this;
        }

        /**
         * And type value greater than or equal to criteria.
         *
         * @param value the value
         * @return the criteria
         */
        public Criteria andTypeValueGreaterThanOrEqualTo(BigDecimal value) {
            addCriterion("Type_value >=", value, "typeValue");
            return (Criteria) this;
        }

        /**
         * And type value less than criteria.
         *
         * @param value the value
         * @return the criteria
         */
        public Criteria andTypeValueLessThan(BigDecimal value) {
            addCriterion("Type_value <", value, "typeValue");
            return (Criteria) this;
        }

        /**
         * And type value less than or equal to criteria.
         *
         * @param value the value
         * @return the criteria
         */
        public Criteria andTypeValueLessThanOrEqualTo(BigDecimal value) {
            addCriterion("Type_value <=", value, "typeValue");
            return (Criteria) this;
        }

        /**
         * And type value in criteria.
         *
         * @param values the values
         * @return the criteria
         */
        public Criteria andTypeValueIn(List<BigDecimal> values) {
            addCriterion("Type_value in", values, "typeValue");
            return (Criteria) this;
        }

        /**
         * And type value not in criteria.
         *
         * @param values the values
         * @return the criteria
         */
        public Criteria andTypeValueNotIn(List<BigDecimal> values) {
            addCriterion("Type_value not in", values, "typeValue");
            return (Criteria) this;
        }

        /**
         * And type value between criteria.
         *
         * @param value1 the value 1
         * @param value2 the value 2
         * @return the criteria
         */
        public Criteria andTypeValueBetween(BigDecimal value1, BigDecimal value2) {
            addCriterion("Type_value between", value1, value2, "typeValue");
            return (Criteria) this;
        }

        /**
         * And type value not between criteria.
         *
         * @param value1 the value 1
         * @param value2 the value 2
         * @return the criteria
         */
        public Criteria andTypeValueNotBetween(BigDecimal value1, BigDecimal value2) {
            addCriterion("Type_value not between", value1, value2, "typeValue");
            return (Criteria) this;
        }

        /**
         * And tickets create is null criteria.
         *
         * @return the criteria
         */
        public Criteria andTicketsCreateIsNull() {
            addCriterion("Tickets_create is null");
            return (Criteria) this;
        }

        /**
         * And tickets create is not null criteria.
         *
         * @return the criteria
         */
        public Criteria andTicketsCreateIsNotNull() {
            addCriterion("Tickets_create is not null");
            return (Criteria) this;
        }

        /**
         * And tickets create equal to criteria.
         *
         * @param value the value
         * @return the criteria
         */
        public Criteria andTicketsCreateEqualTo(Date value) {
            addCriterion("Tickets_create =", value, "ticketsCreate");
            return (Criteria) this;
        }

        /**
         * And tickets create not equal to criteria.
         *
         * @param value the value
         * @return the criteria
         */
        public Criteria andTicketsCreateNotEqualTo(Date value) {
            addCriterion("Tickets_create <>", value, "ticketsCreate");
            return (Criteria) this;
        }

        /**
         * And tickets create greater than criteria.
         *
         * @param value the value
         * @return the criteria
         */
        public Criteria andTicketsCreateGreaterThan(Date value) {
            addCriterion("Tickets_create >", value, "ticketsCreate");
            return (Criteria) this;
        }

        /**
         * And tickets create greater than or equal to criteria.
         *
         * @param value the value
         * @return the criteria
         */
        public Criteria andTicketsCreateGreaterThanOrEqualTo(Date value) {
            addCriterion("Tickets_create >=", value, "ticketsCreate");
            return (Criteria) this;
        }

        /**
         * And tickets create less than criteria.
         *
         * @param value the value
         * @return the criteria
         */
        public Criteria andTicketsCreateLessThan(Date value) {
            addCriterion("Tickets_create <", value, "ticketsCreate");
            return (Criteria) this;
        }

        /**
         * And tickets create less than or equal to criteria.
         *
         * @param value the value
         * @return the criteria
         */
        public Criteria andTicketsCreateLessThanOrEqualTo(Date value) {
            addCriterion("Tickets_create <=", value, "ticketsCreate");
            return (Criteria) this;
        }

        /**
         * And tickets create in criteria.
         *
         * @param values the values
         * @return the criteria
         */
        public Criteria andTicketsCreateIn(List<Date> values) {
            addCriterion("Tickets_create in", values, "ticketsCreate");
            return (Criteria) this;
        }

        /**
         * And tickets create not in criteria.
         *
         * @param values the values
         * @return the criteria
         */
        public Criteria andTicketsCreateNotIn(List<Date> values) {
            addCriterion("Tickets_create not in", values, "ticketsCreate");
            return (Criteria) this;
        }

        /**
         * And tickets create between criteria.
         *
         * @param value1 the value 1
         * @param value2 the value 2
         * @return the criteria
         */
        public Criteria andTicketsCreateBetween(Date value1, Date value2) {
            addCriterion("Tickets_create between", value1, value2, "ticketsCreate");
            return (Criteria) this;
        }

        /**
         * And tickets create not between criteria.
         *
         * @param value1 the value 1
         * @param value2 the value 2
         * @return the criteria
         */
        public Criteria andTicketsCreateNotBetween(Date value1, Date value2) {
            addCriterion("Tickets_create not between", value1, value2, "ticketsCreate");
            return (Criteria) this;
        }
    }

    /**
     * The type Criteria.
     */
    public static class Criteria extends GeneratedCriteria {
        /**
         * Instantiates a new Criteria.
         */
        protected Criteria() {
            super();
        }
    }

    /**
     * The type Criterion.
     */
    public static class Criterion {
        private String condition;

        private Object value;

        private Object secondValue;

        private boolean noValue;

        private boolean singleValue;

        private boolean betweenValue;

        private boolean listValue;

        private String typeHandler;

        /**
         * Gets condition.
         *
         * @return the condition
         */
        public String getCondition() {
            return condition;
        }

        /**
         * Gets value.
         *
         * @return the value
         */
        public Object getValue() {
            return value;
        }

        /**
         * Gets second value.
         *
         * @return the second value
         */
        public Object getSecondValue() {
            return secondValue;
        }

        /**
         * Is no value boolean.
         *
         * @return the boolean
         */
        public boolean isNoValue() {
            return noValue;
        }

        /**
         * Is single value boolean.
         *
         * @return the boolean
         */
        public boolean isSingleValue() {
            return singleValue;
        }

        /**
         * Is between value boolean.
         *
         * @return the boolean
         */
        public boolean isBetweenValue() {
            return betweenValue;
        }

        /**
         * Is list value boolean.
         *
         * @return the boolean
         */
        public boolean isListValue() {
            return listValue;
        }

        /**
         * Gets type handler.
         *
         * @return the type handler
         */
        public String getTypeHandler() {
            return typeHandler;
        }

        /**
         * Instantiates a new Criterion.
         *
         * @param condition the condition
         */
        protected Criterion(String condition) {
            super();
            this.condition = condition;
            this.typeHandler = null;
            this.noValue = true;
        }

        /**
         * Instantiates a new Criterion.
         *
         * @param condition   the condition
         * @param value       the value
         * @param typeHandler the type handler
         */
        protected Criterion(String condition, Object value, String typeHandler) {
            super();
            this.condition = condition;
            this.value = value;
            this.typeHandler = typeHandler;
            if (value instanceof List<?>) {
                this.listValue = true;
            } else {
                this.singleValue = true;
            }
        }

        /**
         * Instantiates a new Criterion.
         *
         * @param condition the condition
         * @param value     the value
         */
        protected Criterion(String condition, Object value) {
            this(condition, value, null);
        }

        /**
         * Instantiates a new Criterion.
         *
         * @param condition   the condition
         * @param value       the value
         * @param secondValue the second value
         * @param typeHandler the type handler
         */
        protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
            super();
            this.condition = condition;
            this.value = value;
            this.secondValue = secondValue;
            this.typeHandler = typeHandler;
            this.betweenValue = true;
        }

        /**
         * Instantiates a new Criterion.
         *
         * @param condition   the condition
         * @param value       the value
         * @param secondValue the second value
         */
        protected Criterion(String condition, Object value, Object secondValue) {
            this(condition, value, secondValue, null);
        }
    }
}